{extend name="base" /}
{block name="css"}
<link rel="stylesheet" type="text/css" href="__STATIC__/plugins/mmgrid/mmGrid.css?v={$v}" />
{/block}
{block name="js"}
<script src="__STATIC__/plugins/mmgrid/mmGrid.js?v={$v}" type="text/javascript"></script>
<script src="__ADMIN__/settlements/settlements.js?v={$v}" type="text/javascript"></script>
{/block}
{block name="main"}
<div id='alertTips' class='alert alert-success alert-tips fade in'>
  <div id='headTip' class='head'><i class='fa fa-lightbulb-o'></i>操作说明</div>
  <ul class='body'>
    <li>本功能主要用于按商家进行批量结算。结算时不需要商家申请，管理员点击“生成结算单”则自动完成订单的佣金结算和在线支付订单返款。</li>
    <li>订单结算款会返还到商家在本系统中的商家钱包中</li>
  </ul>
</div>
<div class="wst-toolbar">
<select id="areaId1" class='j-ipt j-areas' level="0" onchange="WST.ITAreas({id:'areaId1',val:this.value,className:'j-areas'});">
  <option value="">-商家所在地-</option>
  {volist name="areaList" id="vo"}
  <option value="{$vo['areaId']}">{$vo['areaName']}</option>
  {/volist}
</select>
<input type="text" name="shopName"  placeholder='店铺名称/店铺编号' id="shopName" class='j-ipt'/>
<button class="btn btn-primary" type='button' onclick='javascript:loadShopGrid()'><i class='fa fa-search'></i>查询</button>
{if WSTGrant('SJJS_04')}
<button class="btn btn-success" type='button' onclick='javascript:generateSettleByShop()'><i class="fa fa-check-circle"></i>生成结算单</button>
{/if}
<div style='clear:both'></div>
</div>
<div class='wst-grid'>
<div id="mmg" class="mmg"></div>
<div id="pg" style="text-align: right;"></div>
</div>
<script>
$(function(){
	initGrid({$p});
})
</script>
{/block}